{include file="public_head" /}

<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">

<!-- datatables -->

<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>

<!-- chk_3 -->

<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>



<body class="nav-md">



<div class="container body">





    <div class="main_container">



        {include file="public_sidebar,public_nav" /}



        <!-- page content -->

        <div class="right_col" role="main">

            <div class="">

                <div class="page-title">

                    <div class="title_left">

                        <h3>



                        </h3>

                    </div>

                </div>

                <div class="clearfix"></div>



                <div class="row">



                    <div class="col-md-12 col-sm-12 col-xs-12">

                        <div class="x_panel">

                            <div class="x_title">

                                <h2>出入库记录</h2>



                                <div class="clearfix"></div>

                            </div>
                            <div class="title_left">
                                <form name="form"  method="get" action="">
                                    {eq name=":session('auding_status')" value="100"}
                                    <div class="input-group col-md-2 col-sm-3 col-xs-4" style="float: left;margin: 0 2%;">
                                        <select name="shop_id" class="select2_single" style="width: 100%;"
                                                tabindex="-1">
                                            <option value="0">- 请选择门店 -</option>
                                        </select>
                                    </div>
                                    {/eq}



                                    <!--<button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索-->

                                    <!--</button>-->
                                </form>
                            </div>

                            <div class="x_content">

                                <form name="form" id="form" method="get" action="">
                                    <div class="title_left">
                                        <div class="input-group col-md-2 col-sm-3 col-xs-4" style="float: left;">
                                            <select name="type" class="select2_single" style="width: 100%;"
                                                    tabindex="-1">
                                                <option value="0">- 全部类型 -</option>
                                                <option value="1" {eq name=':input("type")' value='1' }selected{/eq}>总库入库</option>
                                                <option value="2" {eq name=':input("type")' value='2' }selected{/eq}>总库出库到门店</option>
                                                <option value="3" {eq name=':input("type")' value='3' }selected{/eq}>门店出库总库</option>
                                                <option value="4" {eq name=':input("type")' value='4' }selected{/eq}>门店出库门店</option>

                                            </select>
                                        </div>
                                        <div class="input-group col-md-2 col-sm-3 col-xs-4" style="float: left; margin: 0 20px;">
                                            <select name="shop_id" class="select2_single" style="width: 100%;"
                                                    tabindex="-1">
                                                <option value="0">- 全部门店 -</option>
                                                {volist name=":db('shop')->select()" id="vo"}
                                                <option value="{$vo.id}" {eq name=':input("shop_id")' value='$vo.id' }selected{/eq}>{$vo.shop_title}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                        <div class="col-md-2 col-sm-3 col-xs-3 form-group pull-left top_search">
                                            <div class="input-group">
                                                <input type="text" class="form-control" name="title"
                                                       placeholder="输入搜下内容..." value="{:input('title')}">
                                            </div>

                                        </div>
                                        <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索</button>
                                    </div>
                                    <table style="border-bottom:1px solid #ddd;" class="table table-striped table-bordered table-hover">

                                        <thead>

                                        <tr class="success">

                                            <!--<th style="width: 2%; padding: 10px;">-->

                                            <!--<input type="checkbox" class="checkall"-->

                                            <!--onclick="CheckAll(this.checked);"/>-->

                                            <!--</th>-->

                                            <!--<th>排序</th>-->

                                            <th width="30">ID</th>

                                            <th width="">出入库类型</th>

                                            <th width="">出入库数量</th>

                                            <th width="">出入库规格</th>
                                            <th width="">出入库到门店</th>




                                        </tr>

                                        </thead>

                                        <tbody>

                                        {empty name="data"}

                                        <tr><td colspan="5"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>

                                        {/empty}



                                        {volist name="data" id="item"}


                                        <tr>
                                            <td>{$item.id}</td>
                                            <td>
                                                {switch name="item.type"}
                                                {case 1}总库入库{/case}
                                                {case 2}总库出库门店{/case}
                                                {case 3}门店出库总库{/case}
                                                {case 4}门店出库门店{/case}
                                                {/switch}
                                            </td>
                                            <td>{$item.count}</td>
                                            <td>{$item.goods_id}-{$item.title}-{$item.attribute}</td>
                                            <td>{$item.shop_title}</td>

                                        </tr>

                                        {/volist}
                                        </tbody>

                                    </table>
                                    <!-- 分页 -->
                                    <div style="float: right;margin-top: -30px;">{$data->render()}</div>
                                    <button type="button" class="btn btn-success" style="margin-top: 20px;" onclick="dcd()">出入库记录导出</button>
                                </form>

                            </div>

                        </div>

                    </div>



                </div>

            </div>



        </div>

        <!-- /page content -->

    </div>



</div>



{include file="public_foot" /}
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<script type="text/javascript">

    // list

    $(document).ready(function () {

        // select2

        $(".select2_single").select2({

            placeholder: "请选择分类",

            allowClear: true

        });

    });
    //导出excel表格
    function dcd(){
        var type ={:input('type',0)};
        var shop_id ={:input('shop_id',0)};
        var title = "{:input('title',0)}";
        window.location.href = "{:url('daochu')}?type="+type+'&shop_id='+shop_id+'&title='+title;
    }

</script>
<!-- public -->

<script src="__STATIC__/js/public.js"></script>

<!-- layer -->

<script src="__STATIC__/js/layer.js"></script>